<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
	<ui:composition>
		<p:dataTable var="de" value="#{value}" id="#{id}">
			<p:column styleClass="width30">
				<h:outputLabel value="#{de.node.labelValue}" />
			</p:column>

			<p:column rendered="#{!readonly}">
				<p:inputText rendered="#{de.node.dataType == 1}" value="#{de.value}" style="width:90%;"
					maxlength="#{de.node.maxLength}" />

				<p:inputText value="#{de.value}" rendered="#{de.node.dataType == 6}" label="#{de.node.labelValue}">
					<f:convertNumber maxFractionDigits="#{de.maxFractionDigits}"
						maxIntegerDigits="#{de.maxIntegerDigits}" />
				</p:inputText>

				<p:inputTextarea rendered="#{de.node.dataType == 7}" value="#{de.value}" style="width:90%;"
					maxlength="#{de.node.maxLength}" rows="#{de.node.rows}" />

				<p:keyboard value="#{de.value}" rendered="#{de.node.dataType == 2}" showMode="button"
					keypadOnly="true"/>

				<p:selectOneMenu value="#{de.value}" rendered="#{de.node.dataType == 3}" style="width:90%">
					<f:selectItem itemLabel="" itemValue="" />
					<f:selectItems value="#{sessionEnum[de.node.enumName]}" var="en" itemLabel="#{en.name}"
						itemValue="#{en.value}" />
				</p:selectOneMenu>

				<p:selectBooleanCheckbox value="#{de.value}" rendered="#{de.node.dataType == 8}" />

				<p:calendar value="#{de.value}" rendered="#{de.node.dataType == 4}" navigator="true"
					converter="dateConverter" 
					pattern="dd/MM/yyyy" showOn="button" />

				<p:calendar value="#{de.value}" rendered="#{de.node.dataType == 5}" navigator="true"
					converter="dateTimeConverter"
					pattern="dd/MM/yyyy HH:mm" showOn="button" />
			</p:column>

			<p:column rendered="#{readonly}">
				<h:outputText
					rendered="#{de.node.dataType == 1 or de.node.dataType == 6 or de.node.dataType == 7 or de.node.dataType==2 or de.node.dataType == 4 or de.node.dataType == 5}"
					value="#{de.value}" />

				<h:outputText value="#{de.value}" converter="enumConverter" enumName="#{de.node.enumName}"
					rendered="#{de.node.dataType == 3}" />
					
				<p:selectBooleanCheckbox value="#{de.value}" rendered="#{de.node.dataType == 8}" disabled="true" />
			</p:column>
		</p:dataTable>
	</ui:composition>
</h:body>
</html>